﻿using System;

namespace _59_输出整数的二进制表示形式_类型转换
{
    class Program
    {
        static void Main(string[] args)
        {
            byte v1 = 155;
            int v2 = 916652;
            long v3 = 1200365172;
            short v4 = 5185;


            //使用convert.ToString方法将以上四个变量的值国专换为二进制字符串
            Console.WriteLine("原始值              二进制");
            Console.WriteLine("--------------------------------------");
            Console.WriteLine($"{v1,-15}{Convert.ToString(v1, 2),-80}");
            Console.WriteLine($"{v2,-15}{Convert.ToString(v2, 2),-80}");
            Console.WriteLine($"{v3,-15}{Convert.ToString(v3, 2),-80}");
            Console.WriteLine($"{v4,-15}{Convert.ToString(v4, 2),-80}");
        }
    }
}
